package com.xhji.spider.webmagic.pipeline;

import com.xhji.spider.entity.PageDetail;
import com.xhji.spider.mapper.PageDetailMapper;
import org.springframework.stereotype.Component;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.PageModelPipeline;

import javax.annotation.Resource;

@Component
public class PageDetailModelPipeline implements PageModelPipeline<PageDetail> {

    @Resource
    private PageDetailMapper pageDetailMapper;

    @Override
    public void process(PageDetail pageDetail, Task task) {
        pageDetailMapper.insert(pageDetail);
    }
}
